package com.hsgene.order.constants.v1;

/**
 * 订单费用状态枚举
 *
 * @author wangbing
 * @version 1.0, 2018/9/19
 */
public enum OrderChargeStatus {

    /**
     * 状态枚举
     */
    INIT(0, "init", "未付款"),
    CHARGED(1, "charged", "已付款"),
    CONFIRMED(2, "confirmed", "已确认"),
    UNDEFINED(99, "undefined", "未定义");

    private final int code;

    private final String value;

    private final String desc;

    OrderChargeStatus(int code, String value, String desc) {
        this.code = code;
        this.value = value;
        this.desc = desc;
    }

    public static OrderChargeStatus getEnum(String value) {
        for (OrderChargeStatus orderChargeStatus : values()) {
            if (orderChargeStatus.value.equals(value)) {
                return orderChargeStatus;
            }
        }
        return UNDEFINED;
    }

    public int getCode() {
        return code;
    }

    public String getValue() {
        return value;
    }

    public String getDesc() {
        return desc;
    }
}
